package com.chenglu.android.goodsinfo.adapter;

import android.content.Context;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chenglu.android.R;
import com.chenglu.android.common.utils.GlideUtils;
import com.chenglu.android.common.utils.LogUtils;
import com.google.gson.Gson;


import java.util.List;

/**
 * @author: lyj
 * @Created: by Copyright 2023/3/13 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：评论图片的数据
 */
public class CommentItemPicAdapter extends BaseQuickAdapter< String, BaseViewHolder> {

    private Context context ;
    public CommentItemPicAdapter(@Nullable Context context, List<String> data) {
        super(R.layout.item_pic, data);
        this.context = context;

    }



    @Override
    protected void convert(@NonNull BaseViewHolder helper,String item) {

        if(item!=null){
            LogUtils.d("列表的数据"+ new Gson().toJson(item));
            ImageView imageView =  helper.getView(R.id.iv_pic_adapter);

            GlideUtils.setImageView(context,item,imageView,8);
        }

    }
}
